<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>画一椭圆并填充</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.imagefilledellipse" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagefilledellipse</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">imagefilledellipse</span> &mdash; <span class="dc-title">画一椭圆并填充</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagefilledellipse-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagefilledellipse</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$image</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$cx</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$cy</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$width</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$height</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$color</code></span>
   ) : <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   画一椭圆并填充到指定的 <code class="parameter">image</code>。
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagefilledellipse-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<code class="parameter">image</code></dt>

<dd>
<p class="para">由图象创建函数(例如<span class="function"><a href="imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>)返回的图象资源。</p></dd>

    
     <dt>
<code class="parameter">cx</code></dt>

     <dd>

      <p class="para">
       中央的 x 坐标。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">cy</code></dt>

     <dd>

      <p class="para">
       中央的 y 坐标。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">width</code></dt>

     <dd>

      <p class="para">
       椭圆的宽度。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">height</code></dt>

     <dd>

      <p class="para">
       椭圆的高度。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">color</code></dt>

     <dd>

      <p class="para">
       要填充的颜色。颜色标识由函数       <span class="function"><a href="imagecolorallocate.html" class="function">imagecolorallocate()</a></span> 创建。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagefilledellipse-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.imagefilledellipse-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3695">
    <p><strong>Example #1 <span class="function"><strong>imagefilledellipse()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;create&nbsp;a&nbsp;blank&nbsp;image<br /></span><span style="color: #0000BB">$image&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecreatetruecolor</span><span style="color: #007700">(</span><span style="color: #0000BB">400</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">300</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;fill&nbsp;the&nbsp;background&nbsp;color<br /></span><span style="color: #0000BB">$bg&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;choose&nbsp;a&nbsp;color&nbsp;for&nbsp;the&nbsp;ellipse<br /></span><span style="color: #0000BB">$col_ellipse&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">255</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">255</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">255</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;draw&nbsp;the&nbsp;white&nbsp;ellipse<br /></span><span style="color: #0000BB">imagefilledellipse</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">200</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">150</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">300</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">200</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$col_ellipse</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;output&nbsp;the&nbsp;picture<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Content-type:&nbsp;image/png"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagepng</span><span style="color: #007700">(</span><span style="color: #0000BB">$image</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="mediaobject">
     
     <div class="imageobject">
      <img src="images/21009b70229598c6a80eef8b45bf282b-imagefilledellipse.png" alt="例子输出： imagefilledellipse()" width="400" height="300" />
     </div>
    </div>
   </div>
  </p>
 </div>

 <div class="refsect1 notes" id="refsect1-function.imagefilledellipse-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">此函数需要 GD 2.0.1 或更高版本(推荐 2.0.28 及更高版本)。</span></p></blockquote>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.imagefilledellipse-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="imageellipse.html" class="function" rel="rdfs-seeAlso">imageellipse()</a> - 画一个椭圆</span></li>
    <li class="member"><span class="function"><a href="imagefilledarc.html" class="function" rel="rdfs-seeAlso">imagefilledarc()</a> - 画一椭圆弧且填充</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>